app.controller("formController", function($scope, HttpService) {
	/*HttpService.ajaxData('get', '/lunbo/get').then(function(data) {
		$scope.myList = data;
		var url = $scope.myList;
		console.log(url);
		$scope.thisIndex = function(index){
			alert($(this).index())
		}
	}, function(err) {
		console.log(err);
	});*/

});
/*轮播图请求*/
var urls = "http://119.29.159.163:8080/baihua"
$.ajax({
	type: "get",
	url: urls + "/lunbo/get",
	async: true,
	dataType: "json",
	success: function(data) {
		var html = '';
		for(var i = 0; i < data.length; i++) {
			html += "<div class='item'>" + "<img src=" + data[i].url + ">" + "</div>"
		}
		$("#carousel-inner").html(html);
		$("#carousel-inner>div:first-child").addClass("active")
	},
	error: function(err) {
		console.log(err)
	}
});

/*导航栏*/
$.ajax({
	type: 'get',
	url: urls + "/video/get",
	async: true,
	dataType: "json",
	success: function(res) {
		console.log(res[0].type);
		var html = "";
		for(var i = 0; i < res.length; i++) {
			html += "<li><a href='" + res[i].url + "'>" + res[i].type + "</a></li>"
		}
		$(".nav-pills").html(html);
		$(".nav-pills>li:first-child").addClass("actives");
		$(".nav-pills li").click(function() {
			$(this).addClass("actives").siblings().removeClass("actives");
		});
	},
	error: function(err) {
		alert(err)
	}
})